#include<iostream>
#include <string>
using namespace std;

string bian(string s) {
	string s2;
	s2 += s[0];
	for (int i = 1; i < s.size(); i++) {
		s2 += ((s[i] - '0') ^ (s[i - 1] - '0')+'0');
	}
	return s2;
}
int main() {
	int n, t;
	string s;
	cin >> n >> t;
	getchar();
	cin >> s;
	int x = 1;
	while (x < n) {
		x <<= 1;
	}
	t %= x;
	for (int i = 0; i < t; i++) {
		s = bian(s);
	}
	cout << s;
	return 0;
}